//
// Created by Arikes on 9/21/21.
//

#ifndef DESIGNERMODE_CONCRETEDECORATOR_H
#define DESIGNERMODE_CONCRETEDECORATOR_H

#include "Decorator.h"
namespace DecoratorMode
{
    class ConcreteDecorator:public Decorator
    {
    public:
        ConcreteDecorator(Component* component):Decorator(component)
        {

        }

        virtual void operation()
        {
            addExtraFunc();
            Decorator::operation();
        }

        void addExtraFunc()
        {
            std::cout<<"为具体构件角色增加额外的功能addedFunction()"<<std::endl;
        }

    private:

    };
}

#endif //DESIGNERMODE_CONCRETEDECORATOR_H

//DecoratorMode::Component* pComponent = new DecoratorMode::ConcreteComponent;
//DecoratorMode::Decorator* pDecorator = new DecoratorMode::ConcreteDecorator(pComponent);
//pDecorator->operation();